/**
 * 
 */
package com.gosophia.orgManagement.action;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.organizationManagement.dto.PositionDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;
import com.opensymphony.xwork2.ActionContext;

/**
 * 添加职位用action
 * @author wangxinbing,zhaoyan
 * @since  2010-12-31
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Controller("AddPositionAction")
@Scope("prototype")
public class AddPositionAction extends BaseSupportAction {
    private static final long serialVersionUID = 1L;
    private Long orgId;
    private Long toId;
    //这个没用了
    private PositionDTO posDTO;
    private PositionDTO positionDTO;
    private List<PositionDTO> positionDTOs;
    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    
    @LogRecord(eventAction="职位管理-添加职位",eventTarget="positionDTO")
    @Override
    public String _execute()throws Exception{
        positionDTOs = organizationManagementWebService.addPosition(positionDTO, orgId, toId);
        if(positionDTOs!=null){
            super.getRequestResult().setRsltCode("0");
            super.getRequestResult().setMessage("添加职位成功");
            return SUCCESS;
        }
        else{
            super.getRequestResult().setRsltCode("0");
            super.getRequestResult().setMessage("添加职位失败");
            return SUCCESS;
        }
    }
    public Long getOrgId() {
        return orgId;
    }
    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }
    public Long getToId() {
        return toId;
    }
    public void setToId(Long toId) {
        this.toId = toId;
    }
    public PositionDTO getPositionDTO() {
        return positionDTO;
    }
	public PositionDTO getPosDTO() {
		return posDTO;
	}
	public void setPosDTO(PositionDTO posDTO) {
		this.posDTO = posDTO;
	}
	public void setPositionDTO(PositionDTO positionDTO) {
		this.positionDTO = positionDTO;
	}
    public List<PositionDTO> getPositionDTOs() {
        return positionDTOs;
    }
    public void setPositionDTOs(List<PositionDTO> positionDTOs) {
        this.positionDTOs = positionDTOs;
    }

    
    
}
